package com.mio.web.service.product;

import java.util.List;

import org.durcframework.core.expression.ExpressionQuery;
import org.durcframework.core.expression.subexpression.ValueExpression;
import org.durcframework.core.service.CrudService;

import com.mio.web.common.MioConstants;
import com.mio.web.dao.product.ProductDao;
import com.mio.web.entity.product.Product;
import com.mio.web.entity.product.ProductSch;
import com.mio.web.entity.producttype.ProducttypeSch;

import org.springframework.stereotype.Service;

@Service
public class ProductService extends CrudService<Product, ProductDao> {

	public List<Product> listIndexProduct() {
		ExpressionQuery query = new ExpressionQuery();
		query.addValueExpression(new ValueExpression("isDeleted", MioConstants.DELETED_FALSE));
		query.setLimit(5);
		query.setFirstResult(0);
		query.addSort("sortId", "asc");
		query.addSort("id", "desc");
		return this.getDao().find(query);

	}

}